/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Modelo;

import Vista.Applet;
import java.awt.Image;

/**
 *
 * @author VIC
 */
import java.io.*;

public class Terreno implements Serializable {
    private char simbolo;
    private int pos;
    private String nombre;
    private static String tipo[]={"montana","pradera","playa","mar"};
    private static char carac[]={'^','_','.','~'};
    private static Image imagen[];


    public static void inicializar(Applet a){
        imagen=new Image[4];
        imagen[0]=a.getImage(a.getCodeBase(),"montana.png");
        imagen[1]=a.getImage(a.getCodeBase(),"terreno.png");
        imagen[2]=a.getImage(a.getCodeBase(),"arena.png");
        imagen[3]=a.getImage(a.getCodeBase(),"mar.png");
    }
    /*public Terreno(char simbolo, String nombre){
	this.simbolo = simbolo;

	this.nombre = nombre;
    }*/
    public Terreno(char simbolo){
        this.simbolo=simbolo;
        for(int i=0;i<4;i++)
            if(carac[i]==simbolo) {
                pos=i;
                this.nombre=tipo[i];
                break;
            }
    }

    public char getSimbolo(){
	return simbolo;
    }
    public String getNombre(){
	return nombre;
    }


    public Image getImage(){
        return imagen[pos];
    }

    public Image getImagen(){
        return imagen[pos];
    }

}